package com.mvp.lt.airlineview.data.event;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * $activityName
 *
 * @author LiuTao
 * @date 2019/3/25/025
 */


public class LocationEvent implements Parcelable {
    boolean isLocatian = false;
    String name;
    String code;
    double lat;
    double lng;

    public LocationEvent() {
    }

    public LocationEvent(boolean isLocatian, String name, String code, double lat, double lng) {
        this.isLocatian = isLocatian;
        this.name = name;
        this.code = code;
        this.lat = lat;
        this.lng = lng;
    }

    protected LocationEvent(Parcel in) {
        isLocatian = in.readByte() != 0;
        name = in.readString();
        code = in.readString();
        lat = in.readDouble();
        lng = in.readDouble();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeByte((byte) (isLocatian ? 1 : 0));
        dest.writeString(name);
        dest.writeString(code);
        dest.writeDouble(lat);
        dest.writeDouble(lng);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<LocationEvent> CREATOR = new Creator<LocationEvent>() {
        @Override
        public LocationEvent createFromParcel(Parcel in) {
            return new LocationEvent(in);
        }

        @Override
        public LocationEvent[] newArray(int size) {
            return new LocationEvent[size];
        }
    };

    public boolean isLocatian() {
        return isLocatian;
    }

    public void setLocatian(boolean locatian) {
        isLocatian = locatian;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public double getLat() {
        return lat;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }

    public double getLng() {
        return lng;
    }

    public void setLng(double lng) {
        this.lng = lng;
    }

    @Override
    public String toString() {
        return "LocationEvent{" +
                "isLocatian=" + isLocatian +
                ", name='" + name + '\'' +
                ", code='" + code + '\'' +
                ", lat=" + lat +
                ", lng=" + lng +
                '}';
    }
}
